package com.nebula.core.dsl.builder;


import com.nebula.core.entity.vo.Edge;

/**
 * @author zhangtao
 */
public interface FetchStatementBuilder extends StatementBuilder {

    interface FetchStatement extends FetchStart, FetchTypeOut, FetchFromTagOut, FetchFromEdgeOut, FetchYieldOut {
    }

    interface FetchStart extends FetchType {
    }

    interface FetchType {
        /**
         * 检点/边类型
         *
         * @param types
         * @return
         */
        FetchTypeOut on(String... types);
    }

    interface FetchTypeOut extends FetchFromTag, FetchFromEdge {

    }

    interface FetchFromTag {
        /**
         * 检索vid
         *
         * @param vids
         * @return
         */
        FetchFromTagOut from(Object... vids);

        /**
         * 检索使用引用变量
         *
         * @param reference
         * @return
         */
        FetchFromTagOut fromPipe(String reference);
    }

    interface FetchFromTagOut extends FetchYield, Build {
    }

    interface FetchFromEdge {
        /**
         * 检索边vid
         *
         * @param edges
         * @return
         */
        FetchFromEdgeOut from(Edge... edges);
    }

    interface FetchFromEdgeOut extends FetchYield, Build {
    }

    interface FetchYield {
        /**
         * 返回字段
         *
         * @param field
         * @param alias
         * @return
         */
        FetchYieldOut yield(String field, String alias);
    }

    interface FetchYieldOut extends FetchYield, Build {

    }

}
